package br.com.crazystores.controller;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import br.com.crazystores.model.Camiseta;
import br.com.crazystores.model.Material;

public class testeBanco {
	
		public static void main(String[] args) {
			EntityManagerFactory factory = Persistence.createEntityManagerFactory("crazyPU");
			EntityManager manager = factory.createEntityManager();
			
			Material camiseta = new Material();			
			camiseta.setCor("Branco");
			camiseta.setDescricao("Camiseta");
			camiseta.setDetalhes("Classic");
			
			manager.getTransaction().begin();
			manager.persist(camiseta);
			manager.getTransaction().commit();
	}
}
